const path = require('path');
const fs = require('fs');
const Sequelize = require('sequelize');
const sequelize = new Sequelize({
    dialect: 'sqlite',
    storage: 'F:\\work\\mapIndexTiles\\data/demo.db'
  });

const filePath = path.resolve(__dirname,"../models");
const files = fs.readdirSync(filePath);
if(files&&files.length>0){
    files.forEach((filename)=>{
        if(/^.+\.js$/g.test(filename)){
            if(filename!=='index.js'){
              sequelize.import(path.join(filePath,filename));
            }
        }
    })
}
module.exports = sequelize;